<?php
/**
 * @version        $Id: admin_record_ok.php 2014年8月20日Z yeshili $
 * @package        YeshiliCMS.Admin
 * @copyright      Copyright (c) 2014 - 2050, YeshiliCMS, Inc.
 * @license        http://help.****.com/YeshiliCMS/help.html
 * @link           http://www.****.com
 */
include '../inc/config.php';
require 'admin_session.php';
get_rank($_SESSION['id']); 
$act = $_GET['act'];
$id =getvar('id');
//删除
if ($act=='del') {
	$db->delete($GLOBALS[dbprefix].'record','id='.$id);
	echo "<script>alert('删除成功!');history.go(-1);</script>";
}
//多选删除
if ($act=='delcheck') {
	$arr=array();
	$arr =$_POST['ck'];
	if(!empty($arr)){
	  foreach ($arr as $v){
		  $db->delete($GLOBALS[dbprefix].'record',"id=".$v);
	  }
	  echo "<script>alert('删除成功!');history.go(-1);</script>";
	}else
	{
	  echo "<script>alert('删除失败!');history.go(-1);</script>";	
	}
}
//清空所有
if ($act=='empty') {
	$db->delete($GLOBALS[dbprefix].'record');
	echo "<script>alert('清空成功!');history.go(-1);</script>";
}

?>
